package com.chenfeng.system.test;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.junit.Before;
import org.junit.Test;

import com.chenfeng.common.test.BaseTest;
import com.chenfeng.common.util.ConstantFinalUtil;
import com.chenfeng.system.pojo.ARegion;
import com.chenfeng.system.service.ISystemService;

public class testhello extends BaseTest
{
	ISystemService iSystemService;
	//测试函数的入口
	@Before
	public void initSys()
	{
		iSystemService = (ISystemService) this.ac.getBean("iSystemService");
	}
	//测试添加单条地区
	@Test
	public void findOne()
	{
		Map<String,Object> map = new HashMap<String,Object>();
		map.put("id", 100);
		ARegion re = this.iSystemService.findOneRegion(map);
		ConstantFinalUtil.LOGGER_SYSTEM.info("查找单条记录{}",re);
	}
	//测试添加多条地区
	@Test 
	public void findCondList()
	{
		Map<String,Object> map = new HashMap<String,Object>();
		map.put("parentId", "0");
		
		List<ARegion> list = this.iSystemService.findCondListRegion(null, map);
		ConstantFinalUtil.LOGGER_SYSTEM.info("list集合{}",list);
	}
	@Test
	public void testFind()
	{
		Map<String,Object> map = new HashMap<String,Object>();
		map.put("id", 2);
		ARegion region = this.iSystemService.findOneRegion(map); 
		ConstantFinalUtil.LOGGER_SYSTEM.info(region.getRegionList());
	}
	

}
